import request from '@/utils/request'

export function get(api, params = {}, headers = {}) {
  return request({
    url: api,
    method: 'GET',
    headers: headers,
    params: params
  })
}

export function post(api, params = {}, headers = {}) {
  return request({
    url: api,
    method: 'POST',
    headers: headers,
    data: params
  })
}

export function put(api, params = {}, headers = {}) {
  return request({
    url: api,
    method: 'PUT',
    headers: headers,
    data: params
  })
}

export function remove(api, params = {}, headers = {}) {
  return request({
    url: api,
    method: 'DELETE',
    headers: headers,
    data: params
  })
}

export function patch(api, params = {}, headers = {}) {
  return request({
    url: api,
    method: 'PATCH',
    headers: headers,
    data: params
  })
}
